package comm.bean;

import comm.config.KafkaConsumerConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.kafka.config.KafkaListenerContainerFactory;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

@Configuration
@Service
public class GroupBean {

    @Autowired
    private KafkaConsumerConfig kafkaConsumerConfig;

    @Value("${handlecenter.kafka.consumer.RawDataMessageType.id}")
    public String RawDataMessageType;

    @Value("${ServerSocket.port}")
    public Integer Port;

    @Bean(name = "RawDataMessageTypeResponseFactory")
    @Primary
    public KafkaListenerContainerFactory<?> batchRecordRawDataMessageType() {
        return kafkaConsumerConfig.batchRecordConsumerFactoryByGroudid(RawDataMessageType);
    }


}
